<?php
add_theme_support( 'post-thumbnails' );

if ( function_exists('register_sidebar') ) {
	register_sidebar(array(
		'name' => 'Sidebar',
		'before_widget' => '<div id="%1$s" class="%2$s">',
		'after_widget' => '</div>',
		'before_title' => '<h4>',
		'after_title' => '</h4>',
		'after_title' => '</h4>',
	));

	register_sidebar(array(
		'name' => 'Social Sidebar',
		'id' => 'social_sidebar',
		'before_widget' => '<div id="%1$s" class="%2$s">',
		'after_widget' => '</div>',
		'before_title' => '<h4>',
		'after_title' => '</h4>',
		'after_title' => '</h4>',

	));
}


/* Menus **/
function register_my_menus() {
register_nav_menus( array(
		'header_menu' =>'Header Navigation',
		'main_menu' => 'Main Menu'
		) );	
}
add_action( 'init', 'register_my_menus' );



function wp_rpt_activation_hook() {
    if(function_exists('add_theme_support')) {

        add_theme_support( 'post-thumbnails' );

		/** thumbnail for featured pages **/

		add_image_size( $name = 'featured', $width = 260, $height = 180, $crop = true );

		/** #2 for post thumbnail */

		add_image_size( $name = 'featured-cats', $width = 260, $height = 156, $crop = true );

		/** #3 for widget thumbnail */

		add_image_size( $name = 'indexloop', $width = 250, $height = 180, $crop = true );

    }

}
add_action('after_setup_theme', 'wp_rpt_activation_hook');

function featured_excerpt(){

$excerpt = get_the_content();

$excerpt = strip_shortcodes($excerpt);

$excerpt = strip_tags($excerpt);

$the_str = substr($excerpt, 0, 80);

return $the_str;

}

/* SHORTCODES WORKOUT */

/* Buttons */
function scbutton( $atts, $content = null ) {
    extract(shortcode_atts(array(
    'link'	=> '#',
    'target'	=> '',
    'variation'	=> '',
    'size'	=> '',
    'align'	=> '',
    ), $atts));

	$style = ($variation) ? ' '.$variation : '';
	$align = ($align) ? ' align'.$align : '';
	$size = ($size == 'large') ? ' large_button' : '';
	$target = ($target == 'blank') ? ' target="_blank"' : '';

	$out = '<a' .$target. ' class="button_link' .$style.$size.$align. '" href="' .$link. '">' .do_shortcode($content). '</a>';
    
    return $out;
}
add_shortcode('scbutton', 'scbutton');
//USAGE:[button link="http://wordpress.org" target="blank" variation="hot_pink" size="large" align="right"]Content Here[/button]



/* Pagination workout */
include ("includes/wc_pagination.php");

include("wc_admin/wc_options.php");

?>